package com.hqyj.emb.system.controller;

import com.hqyj.emb.system.model.Role;
import com.hqyj.emb.system.service.Impl.RoleServiceImpl;
import com.hqyj.emb.system.service.RoleService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;


@WebServlet("/tjQuery")
public class TJquery extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        Map<String, String[]> parameterMap = req.getParameterMap();
        RoleService roleService=new RoleServiceImpl();
        List<Role> roles = roleService.findTj(parameterMap);
        req.setAttribute("userList_db",roles);
        req.getRequestDispatcher("view/system/role/roleList.jsp").forward(req,resp);

    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doPost(req,resp);
    }
}
